package com.demomaster.quickcompat.widget.base;

import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;

import com.demomaster.quickcompat.util.DisplayUtil;


public class QuickViewAttribute {
    Context context;
    public boolean isSquare;
    public float aspectRatio;//宽高比
    public int radius;
    public int radiusLeftTop;
    public int radiusLeftBottom;
    public int radiusRightTop;
    public int radiusRightBottom;
    public boolean checked;
    public Drawable backgroundDrawable;

    public ColorStateList borderColor;
    public int borderWidth =-1;
    public String badgeText;
    public int badgePadding;
    public int badgeTextSize;
    public int badgeTextColor;
    public int badgeGravity;
    public Drawable badgeBackground;
    public boolean showBadge;
    public int badgeMargin;

    public int drawableWidth=-1;
    public int drawableHeight=-1;

    public int gifRes;


    /*--加载布局 start--*/
    public int loadlayout_loadViewId;//加载中
    public int loadlayout_emptyViewId;//空数据
    public int loadlayout_requestErrorViewId;//请求网络错误
    public int loadlayout_contentErrorViewId;//请求成功但数据异常
    /*--加载布局 end--*/

    public float layout_widthPercent=-1;
    public float layout_heightPercent=-1;

    public boolean warpTextLine;//根据控件高度适应行数

    public void setWarpTextLine(boolean warpTextLine) {
        this.warpTextLine = warpTextLine;
    }

    public void setLayout_widthPercent(float layout_widthPercent) {
        this.layout_widthPercent = layout_widthPercent;
    }

    public void setLayout_heightPercent(float layout_heightPercent) {
        this.layout_heightPercent = layout_heightPercent;
    }

    public QuickViewAttribute(Context context) {
        this.context = context;
        this.borderWidth = DisplayUtil.dip2px(context,1);
    }

    //是否是矩形 宽度高度一致
    public void setSquare(boolean isSquare) {
        this.isSquare = isSquare;
    }
    //mRadius
    public void setRadius(int radius){
        this.radius = radius;
    }

    public void setBackgroundDrawable(Drawable backgroundDrawable) {
        this.backgroundDrawable = backgroundDrawable;
    }

    public void setBorderColor(ColorStateList borderColor) {
        this.borderColor = borderColor;
    }

    public void setBorderWidth(int borderWidth) {
        this.borderWidth = borderWidth;
    }

    public Context getContext(){
        return context;
    }

    public void setRadiusLeftTop(int mRadius){
        radiusLeftTop= mRadius;
    }

    public void setRadiusLeftBottom(int mRadius){
        radiusLeftBottom = mRadius;
    }

    public void setRadiusRightTop(int mRadius){
        radiusRightTop = mRadius;
    }

    public void setRadiusRightBottom(int mRadius){
        radiusRightBottom = mRadius;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    public void setBadgeText(String badgeText) {
        this.badgeText = badgeText;
    }

    public void setBadgePadding(int badgePadding) {
        this.badgePadding = badgePadding;
    }

    public void setBadgeTextSize(int badgeTextSize) {
        this.badgeTextSize = badgeTextSize;
    }

    public void setBadgeGravity(int badgeGravity) {
        this.badgeGravity = badgeGravity;
    }

    public void setBadgeBackground(Drawable drawable) {
        this.badgeBackground = drawable;
    }

    public void setShowBadge(boolean showBadge) {
        this.showBadge = showBadge;
    }

    public void setBadgeTextColor(int badgeTextColor) {
        this.badgeTextColor = badgeTextColor;
    }

    public void setBadgeMargin(int badgeMargin) {
        this.badgeMargin = badgeMargin;
    }

    public void setAspectRatio(float aspectRatio) {
        this.aspectRatio = aspectRatio;
    }

    public void setLoadlayout_loadViewId(int loadlayout_loadViewId) {
        this.loadlayout_loadViewId = loadlayout_loadViewId;
    }

    public void setLoadlayout_emptyViewId(int loadlayout_emptyViewId) {
        this.loadlayout_emptyViewId = loadlayout_emptyViewId;
    }

    public void setLoadlayout_requestErrorViewId(int loadlayout_requestErrorViewId) {
        this.loadlayout_requestErrorViewId = loadlayout_requestErrorViewId;
    }

    public void setLoadlayout_contentErrorViewId(int loadlayout_contentErrorViewId) {
        this.loadlayout_contentErrorViewId = loadlayout_contentErrorViewId;
    }

    public void setDrawableWidth(int drawableWidth) {
        this.drawableWidth = drawableWidth;
    }

    public void setDrawableHeight(int drawableHeight) {
        this.drawableHeight = drawableHeight;
    }

    public void setGifRes(int gifRes) {
        this.gifRes = gifRes;
    }
}
